<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2016-10-18
  Time: 19:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" import="java.util.* " pageEncoding="UTF-8"%>
<%@ include file="include.jsp"%>
<html>
<head>
    <title></title>
</head>
<body>
  <table class="ui celled table">
    <thead>
    <tr>
      <th>Name</th>
      <th>Status</th>
      <th>Notes</th>
    </tr>
    </thead>
    <tbody id="tbody">
    </tbody>
  </table>
  <button class="ui button btndemo" id="btn1"  demovalue="1">1</button>
  <button class="ui button btndemo" id="btn2"  demovalue="2">2</button>
  <button class="ui button btndemo" id="btn3"  demovalue="3">3</button>
  <button class="ui button btndemo" id="btn4"  demovalue="4">4</button>
</body>
<script>

  $(function() {
    var param="1";
   /* sendajax();*/
    /*function sendajax(){*/
      $.ajax({
        url:"../news/testInterface",
        type : 'POST',
        dataType : 'json',
        data:{
          param:param
        },
        success : function(rep){
          //清空之前tbody的代码
          $("#tbody").html("");
          console.log(rep)
          for(var i =0 ;i<rep.length;i++){
            console.log(rep[i])
              var dom='<tr>'+
                        '<td>'+rep[i].t0+'</td>'+
                        '<td>test</td>'+
                        '<td>test</td>'+
                      '</tr>';
              $("#tbody").append($(dom));
          }
        }
      });
      console.log("打印")
   /* }*/

   /* $('.btndemo').unbind('click').click(function(){
      param = $(this).attr("demovalue");
      sendajax();
      console.log(param);
    })*/
  })
</script>
</html>
